require "GameWorld/all"

module GameWorld
  module GameServer
    # This class represents the game server
    class Server
      include GameWorld::Actor
      attr_accessor :avatar
      attr_accessor :state
      def initialize(host, port)
        self.state = :logged_out
      end

      def login(username, password)
        # if successful
        self.state = :connected_to_world_server
        # else
        self.state = :logged_out
      end

      def select_world(world)
        self.state = :connected_to_character_server
      end

      def select_character(character)
        self.avatar = Avatar.new
        self.avatar.name = "ninja"
        #TODO: set avatar properties using data received from server
        self.state = :in_game
      end

      def connect_to(host, port)

      end
    end
  end
end
